//处理登录和注册的路由
const express = require('express')
//导入路由处理函数
const login = require('../router_handle/login')
//导入express-joi 
const expressjoi = require('@escook/express-joi')
//导入验证规则
const { loginjoi,registjoi } = require('../limit/login')
//使用express路由
const router = express.Router()
//这里不需要login.regiest()执行
//当有路由访问时会自动执行
// expressjoi(loginjoi)对数据进行验证
router.post('/regist', expressjoi(registjoi), login.regiest)
router.post('/login', expressjoi(loginjoi), login.login)
// 暴露路由
module.exports = router